/*
 * PublisherServerImpl.java
 *
 * Created on 28 luglio 2005, 10.14
 *
 * @version 1.1
 * @author Federico Paparoni
 *
 */

package com.javastaff.btfree;


public class PublisherServerImpl implements PublisherServer{
    
    private ConnectionManager cm=null;
    private Publisher p;
    private Receiver r;
    private int how;
    
    public PublisherServerImpl(String nome,String uuid,Receiver r,int how) {
        p=new Publisher(this, nome,uuid,how);
        p.start();
        this.r=r;
        this.how=how;
    }
    
    public boolean closeConnection() {
        return p.closeConnection();
    }
    
    public void signalError(String e) {
        System.out.println(e.toString());
    }
    
    public void signalConnection(ConnectionManager cm) {
        this.cm=cm;
        r.connectionEstablished();
    }
    
    public ConnectionManager getManager() {
        return cm;
    }
    
}
